#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
double f(double x, int n);
int main()
{
	int n;
	double x;
	scanf("%lf%d", &x, &n);
	printf("%.2f", f(x, n));
	return 0;
}
double f(double x, int n)
{
	int i;
	double s;
	s = x * 1.0 / (1 + x);
	for (i = 2;i <= n;i++) {
		s = x / (i + s);
	}
	return s;
}
#include<stdio.h>
void move(int n, int m, char p1, char p2, char p3);
void p(int n, char p1, char p3);
int sum;
int main()
{
	int n, m, c;
	scanf("%d %d", &n, &m);
	sum = 0;
	move(n, m, 'A', 'B', 'C');
	return 0;
}
void move(int n, int m, char p1, char p2, char p3)
{
	if (n == 1) {
		sum++;
		if (sum == m) {
			p(n, p1, p3);
		}
	}
	else if (n != 1) {
		move(n - 1, m, p1, p3, p2);
		sum++;
		if (sum == m) {
			p(n, p1, p3);
		}
		move(n - 1, m, p2, p1, p3);
	}
}
void p(int n, char p1, char p3)
{
	printf("%d %c  %c\n", n, p1, p3);
}
#include<stdio.h>
int main()
{
	int k, m, i, j, b, n;
	j = 0;
	int a[500], t[500];
	scanf("%d", &m);
	for (i = 0;i < m;i++) {
		scanf("%d", &a[i]);
	}
	for (i = 0;i < m;i++) {
		if (a[i] % 2 != 0) {
			t[j] = a[i];
			j++;
		}
	}for (i = 0;i < j;i++) {
		for (k = i + 1;k < j;k++) {
			if (t[i] > t[k]) {
				n = t[i];
				t[i] = t[k];
				t[k] = n;
			}
		}
	}

	for (k = 0;k < j;k++) {
		printf("%d", t[k]);
		if (k < j - 1)
			printf(",");
	}
	return 0;
}
#include<stdio.h>
int main()
{
	int n, k, j, i, t, a[200];
	float y, b[200];
	scanf("%d%d", &n, &k);
	for (i = 0;i < n;i++) {
		scanf("%d%f", &a[i], &b[i]);
	}
	for (i = 0;i < n;i++) {
		for (j = i + 1;j < n;j++) {
			if (b[i] < b[j]) {
				y = b[i];
				b[i] = b[j];
				b[j] = y;
				t = a[i];
				a[i] = a[j];
				a[j] = t;
			}
		}
	}
	printf("%d %.1f", a[k - 1], b[k - 1]);
	return 0;
}
#include<stdio.h>
#include<string.h>
int main()
{
	int i, n;
	char a[10000];
	gets(a);
	n = strlen(a) - 2;
	for (i = n;i >= 0;i--) {
		printf("%c", a[i]);
	}
	return 0;
}
#include<stdio.h>
int main()
{
	int n;
	scanf("%d", &n);
	int a[300], b[300], c[300], d[300];
	int i, j;
	int e[300];
	for (i = 0; i < n; i++)
	{
		scanf("%d%d%d", &a[i], &b[i], &c[i]);
		e[i] = a[i] + b[i] + c[i];
		d[i] = i + 1;
	}
	for (i = 0; i < n - 1; i++)
	{
		for (j = i + 1; j < n; j++)
		{
			if (e[i] < e[j] || (e[i] == e[j] && a[i] < a[j]) || (e[i] == e[j] && a[i] == a[j] && d[i] > d[j]))
			{
				int temp = e[i];
				e[i] = e[j];
				e[j] = temp;
				int num = a[i];
				a[i] = a[j];
				a[j] = num;
				int sum = d[i];
				d[i] = d[j];
				d[j] = sum;
			}
		}
	}
	for (i = 0; i < 5; i++)
	{
		printf("%d %d\n", d[i], e[i]);
	}
	return 0;
}
#include<stdio.h> 
int pa(int n);
int main(void)
{
	int n;

	while (~scanf("%d", &n)) {
		printf("%d\n", pa(n));
	}

	return 0;
}

int pa(int n)
{
	if (n == 1 || n == 0) {
		return 1;
	}
	else {
		return pa(n - 1) + pa(n - 2);
	}
}